<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="sysOrgnizationList" checkbox="false" pagination="true" treegrid="true" treeField="orgname" fitColumns="true" title="" sortName="id" actionUrl="sysOrgnizationController.do?datagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="ID"  field="id"  hidden="true"  queryMode="group"  width="120"></t:dgCol>
   <t:dgCol title="机构编号"  field="orgid" hidden="true" queryMode="group"  width="120"></t:dgCol>
   <t:dgCol title="系统编号"  field="sysid"  hidden="true"  queryMode="group"  width="120"></t:dgCol>
   <t:dgCol title="机构名称"  field="orgname"  queryMode="group"  width="120"></t:dgCol>
   <t:dgCol title="上级部门编号"  field="parentorgid" hidden="true" queryMode="group"  width="120"></t:dgCol>
   <t:dgCol title="排序"  field="orderno" hidden="true" queryMode="group"  width="120"></t:dgCol>
   <t:dgCol title="是否有效"  field="isvalid"  queryMode="group"  dictionary="ISN"  width="120"></t:dgCol>
   <t:dgCol title="备注"  field="note"  queryMode="group"  width="120"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="100"></t:dgCol>
   <t:dgDelOpt title="删除" url="sysOrgnizationController.do?doDel&id={id}" urlclass="ace_button"  urlfont="fa-trash-o"/>
   <t:dgToolBar title="录入" icon="icon-add" url="sysOrgnizationController.do?goAdd" funname="add"></t:dgToolBar>
   <t:dgToolBar title="编辑" icon="icon-edit" url="sysOrgnizationController.do?goUpdate" funname="updatetree" ></t:dgToolBar>
   <t:dgToolBar title="查看" icon="icon-search" url="sysOrgnizationController.do?goUpdate" funname="detailtree" ></t:dgToolBar>
   <%-- <t:dgToolBar title="导入" icon="icon-put" funname="ImportXls"></t:dgToolBar>
   <t:dgToolBar title="导出" icon="icon-putout" funname="ExportXls"></t:dgToolBar>
   <t:dgToolBar title="批量删除"  icon="icon-remove" url="sysOrgnizationController.do?doBatchDel" funname="deleteALLSelecttree"></t:dgToolBar>
   <t:dgToolBar title="模板下载" icon="icon-putout" funname="ExportXlsByT"></t:dgToolBar> --%>
  </t:datagrid>
  </div>
 </div>
 <script type="text/javascript">
 $(document).ready(function(){
		$("#sysOrgnizationList").treegrid({
 				 onExpand : function(row){
 					var children = $("#sysOrgnizationList").treegrid('getChildren',row.id);
 					 if(children.length<=0){
 					 	row.leaf=true;
 					 	$("#sysOrgnizationList").treegrid('refresh', row.id);
 					 }
 				}
 		});
 });
 
   
 
//导入
function ImportXls() {
	openuploadwin('Excel导入', 'sysOrgnizationController.do?upload', "sysOrgnizationList");
}

//导出
function ExportXls() {
	JeecgExcelExport("sysOrgnizationController.do?exportXls","sysOrgnizationList");
}

//模板下载
function ExportXlsByT() {
	JeecgExcelExport("sysOrgnizationController.do?exportXlsByT","sysOrgnizationList");
}

/**
 * 获取表格对象
 * @return 表格对象
 */
function getDataGrid(){
	var datagrid = $('#'+gridname);
	return datagrid;
}
 </script>
